package cn.jdy.plugins.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import cn.jdy.common.bo.BaseEntry;

/**
 * @desc   访问日志
 * @author ningqian
 * @date   2017-5-16
 */
@Entity
public class VisitLog extends BaseEntry implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	// 根据数据库自动适配 mysql默认自增
	private Long id; // 主键
	private Long liveId; // 直播id
	private String userOpenId; // 用户唯一标识
	private String userNickName; // 昵称
	private String userHeadImg; // 头像
	private String userSex; // 性别:0-未知，1-男性，2-女
	private String operateDesc; // 操作描述
	private String status; // 当前状态1-在线 2-离线

	@ManyToOne
	@JoinColumn(name = "liveId", insertable = false, updatable = false)
	// VisitLog表 liveId 外键关联live表的id
	private Live live;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getLiveId() {
		return liveId;
	}

	public void setLiveId(Long liveId) {
		this.liveId = liveId;
	}

	public String getUserOpenId() {
		return userOpenId;
	}

	public void setUserOpenId(String userOpenId) {
		this.userOpenId = userOpenId;
	}

	public String getUserNickName() {
		return userNickName;
	}

	public void setUserNickName(String userNickName) {
		this.userNickName = userNickName;
	}

	public String getUserHeadImg() {
		return userHeadImg;
	}

	public void setUserHeadImg(String userHeadImg) {
		this.userHeadImg = userHeadImg;
	}

	public String getUserSex() {
		return userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	public String getOperateDesc() {
		return operateDesc;
	}

	public void setOperateDesc(String operateDesc) {
		this.operateDesc = operateDesc;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Live getLive() {
		return live;
	}

	public void setLive(Live live) {
		this.live = live;
	}

}